From a0482815e7334943abe09e541b1e6215f2560965 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 2 Jul 2006 15:12:40 +0000 Subject: [PATCH] Remove redundant assignments to page, which may cause NULL dereferences. 2006-06-30 Matthias Clasen * gtk/gtknotebook.c (gtk_notebook_tab_space): Remove redundant assignments to page, which may cause NULL dereferences. (#346334, Dave Vasilevsky) --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ gtk/gtknotebook.c | 7 ++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8cd7f7455..828ad77fa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-06-30 Matthias Clasen + * gtk/gtknotebook.c (gtk_notebook_tab_space): Remove + redundant assignments to page, which may cause NULL + dereferences. (#346334, Dave Vasilevsky) + * demos/gtk-demo/editable_cells.c: Portability fix. (#346375, Thomas Klausner) diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f8cd7f7455..828ad77fa6 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,9 @@ 2006-06-30 Matthias Clasen + * gtk/gtknotebook.c (gtk_notebook_tab_space): Remove + redundant assignments to page, which may cause NULL + dereferences. (#346334, Dave Vasilevsky) + * demos/gtk-demo/editable_cells.c: Portability fix. (#346375, Thomas Klausner) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index a846aa29db..c032a89238 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -4683,7 +4683,6 @@ gtk_notebook_tab_space (GtkNotebook *notebook, { GtkNotebookPrivate *priv; GtkWidget *widget; - GtkNotebookPage *page; GList *children; gint tab_pos = get_effective_tab_pos (notebook); gint tab_overlap; @@ -4710,6 +4709,8 @@ gtk_notebook_tab_space (GtkNotebook *notebook, while (children) { + GtkNotebookPage *page; + page = children->data; children = children->next; @@ -4725,6 +4726,8 @@ gtk_notebook_tab_space (GtkNotebook *notebook, while (children) { + GtkNotebookPage *page; + page = children->data; children = children->next; @@ -4748,7 +4751,6 @@ gtk_notebook_tab_space (GtkNotebook *notebook, if (*tab_space > *max - *min - tab_overlap) { *show_arrows = TRUE; - page = notebook->focus_tab->data; /* take arrows into account */ *tab_space = widget->allocation.width - tab_overlap - @@ -4784,7 +4786,6 @@ gtk_notebook_tab_space (GtkNotebook *notebook, if (*tab_space > *max - *min - tab_overlap) { *show_arrows = TRUE; - page = notebook->focus_tab->data; /* take arrows into account */ *tab_space = widget->allocation.height - -- 2.30.2